#ifndef PLAYERCONT_H
#define PLAYERCONT_H
#include "VisableObject.h"
#include "Factory.h"
#include "Math.h"
#include "EnemyFish.h"

class PlayerController : public VisableObject
{
private:
	sf::Sprite powerBarFront;
	sf::Sprite powerBarBack;
	void MakePowerBarSprites();
	float energyMax = 100.0f;
	float energy = 50.0f;
	float minXpos = 100.0f;
	float maxXPos = 800.0f;
	float justdiedTimer = 0.0f;
	const char* skeletonFileName = "images/skeletonImage.png";
	bool isDead = false;

public:
	PlayerController(sf::Vector2f startPos = sf::Vector2f(0, 0), float scale = 0.25f, sf::Vector2f startVel = sf::Vector2f(0, 0), const char* fileName = "images/fishImage.png") : VisableObject(startPos, startVel, fileName, scale, "Player")
	{
		EnemyFish* myEnemy = new EnemyFish(sf::Vector2f(100.0f, 400.0f), 1.5f);
		myEnemy->player = this;
		MakePowerBarSprites();
	}

	void Update(float deltaTime);

	void RenderPowerBar(sf::RenderWindow* window)
	{
		window->draw(powerBarBack);
		window->draw(powerBarFront);
	};

	void AteFish(float fishSize);
	void Die();
};


#endif // PLAYERCONT_H